﻿<!--#include file="../../../../../popasp/lasp.asp" -->
<%
	on error resume next
	Dim POP_MVC,tpl,pasp
	set POP_MVC = new POPASP_MVC
	set pasp = POP_MVC
	POP_MVC.mvc_dir = "../../popasp/"
	call POP_MVC.init
	POP_MVC.dG_("startTime") = 57924.93
	POP_MVC.dG_("beginTime") = beginTime__
	
	call G_("initTime")
	
	set tpl = D_
	IF Not isEmpty ( session( "./home/page_trace_where" ) ) Then 
		If session("./home/page_trace_where") = 1 Then 
			set tpl= js_decode(session("./home/page_trace"))
		Else 
			set tpl = js_decode( POP_MVC.file_get_contents(session("./home/page_trace")) )
		End If 
	End If
	call G_("loadTime")
	
	Function getMemory( key )
		getMemory = Application.Contents( "D:\asp\easyasp\test2\xls2__" & key )
	End Function
%>
<% dim key,k %>
<div id="popasp_page_trace" style="position: fixed;bottom:0;right:0;font-size:14px;width:100%;z-index: 999999;color: #000;text-align:left;font-family:'微软雅黑';">
<div id="popasp_page_trace_tab" style="display: none;background:white;margin:0;height: 250px;">
<div id="popasp_page_trace_tab_tit" style="height:30px;padding: 6px 12px 0;border-bottom:1px solid #ececec;border-top:1px solid #ececec;font-size:16px">
	<% 
tpl("_total") = 0
If isArray(tpl("trace")) Then 
tpl("_total") = UBound(tpl("trace")) + 1
Else
Select Case typename( tpl("trace") )
  Case "Dictionary","Files","IVariantDictionary","IRequestDictionary" : tpl("_total") = tpl("trace").Count
  Case "Recordset" : tpl("_total") = tpl("trace").RecordCount
  Case "ISessionObject" : tpl("_total") = tpl("trace").Contents.Count
End Select
End If
tpl("_rownum") = 0
If tpl("_total") >0 Then
For Each key In tpl("trace") : If isObject( tpl("trace")(key) ) Then Set tpl("info") = tpl("trace")(key) Else tpl("info") = tpl("trace")(key)
If tpl("_rownum") = 0 Then tpl("_first") = True Else tpl("_first") = False
tpl("_rownum") = tpl("_rownum") + 1
tpl("_index") = tpl("_rownum") - 1
If tpl("_total") <> 0 AND tpl("_total") = tpl("_rownum") Then tpl("_last") = True Else tpl("_last") = False 
If tpl("_total") < tpl("_rownum") Then tpl("_total") = tpl("_rownum")
%>
    <span style="color:#000;padding-right:12px;height:30px;line-height: 30px;display:inline-block;margin-right:3px;cursor: pointer;font-weight:700"><% Response.Write key %></span>
    <%  Next 
End If  %>
</div>
<div id="popasp_page_trace_tab_cont" style="overflow:auto;height:212px;padding: 0; line-height: 24px">
		<% 
tpl("_total") = 0
If isArray(tpl("trace")) Then 
tpl("_total") = UBound(tpl("trace")) + 1
Else
Select Case typename( tpl("trace") )
  Case "Dictionary","Files","IVariantDictionary","IRequestDictionary" : tpl("_total") = tpl("trace").Count
  Case "Recordset" : tpl("_total") = tpl("trace").RecordCount
  Case "ISessionObject" : tpl("_total") = tpl("trace").Contents.Count
End Select
End If
tpl("_rownum") = 0
If tpl("_total") >0 Then
For Each key In tpl("trace") : If isObject( tpl("trace")(key) ) Then Set tpl("info") = tpl("trace")(key) Else tpl("info") = tpl("trace")(key)
If tpl("_rownum") = 0 Then tpl("_first") = True Else tpl("_first") = False
tpl("_rownum") = tpl("_rownum") + 1
tpl("_index") = tpl("_rownum") - 1
If tpl("_total") <> 0 AND tpl("_total") = tpl("_rownum") Then tpl("_last") = True Else tpl("_last") = False 
If tpl("_total") < tpl("_rownum") Then tpl("_total") = tpl("_rownum")
%>
    <div style="display:none;">
    <ol style="padding: 0; margin:0">
	<% If isObject(tpl("info")) Then %>
		<% 
tpl("_total") = 0
If isArray(tpl("info")) Then 
tpl("_total") = UBound(tpl("info")) + 1
Else
Select Case typename( tpl("info") )
  Case "Dictionary","Files","IVariantDictionary","IRequestDictionary" : tpl("_total") = tpl("info").Count
  Case "Recordset" : tpl("_total") = tpl("info").RecordCount
  Case "ISessionObject" : tpl("_total") = tpl("info").Contents.Count
End Select
End If
tpl("_rownum") = 0
If tpl("_total") >0 Then
For Each k In tpl("info") : If isObject( tpl("info")(k) ) Then Set tpl("item") = tpl("info")(k) Else tpl("item") = tpl("info")(k)
If tpl("_rownum") = 0 Then tpl("_first") = True Else tpl("_first") = False
tpl("_rownum") = tpl("_rownum") + 1
tpl("_index") = tpl("_rownum") - 1
If tpl("_total") <> 0 AND tpl("_total") = tpl("_rownum") Then tpl("_last") = True Else tpl("_last") = False 
If tpl("_total") < tpl("_rownum") Then tpl("_total") = tpl("_rownum")
%>
			<li style="border-bottom:1px solid #EEE;font-size:14px;padding:0 12px"> 
				<% If not IsNumeric(k) Then %>
					<% Response.Write k %> : 
				<%  End If  %>
				<%  If tpl.Exists("item") Then Response.Write tpl("item") End If %>
			</li>
		<%  Next 
End If  %>
	<%  End If  %>
    </ol>
    </div>
		<%  Next 
End If  %>
</div>
</div>
<div id="popasp_page_trace_close" style="display:none;text-align:right;height:15px;position:absolute;top:10px;right:12px;cursor: pointer;"><img style="vertical-align:top;" src="" /></div>
</div>
<div id="popasp_page_trace_open" style="height:30px;float:right;text-align: right;overflow:hidden;position:fixed;bottom:0;right:0;color:#000;line-height:30px;cursor:pointer;"><div style="background:#232323;color:#FFF;padding:0 6px;float:right;line-height:30px;font-size:14px"><%  If tpl.Exists("runtime") Then Response.Write tpl("runtime") End If %></div><img width="30" style="" title="ShowPageTrace" src="<% Response.Write (POP_MVC.logo) %>"></div>
<script type="text/javascript">
(function(){
var tab_tit  = document.getElementById('popasp_page_trace_tab_tit').getElementsByTagName('span');
var tab_cont = document.getElementById('popasp_page_trace_tab_cont').getElementsByTagName('div');
var open     = document.getElementById('popasp_page_trace_open');
var close    = document.getElementById('popasp_page_trace_close').childNodes[0];
var trace    = document.getElementById('popasp_page_trace_tab');
var cookie   = document.cookie.match(/popasp_show_page_trace=(\d\|\d)/);
var history  = (cookie && typeof cookie[1] != 'undefined' && cookie[1].split('|')) || [0,0];
open.onclick = function(){
	trace.style.display = 'block';
	this.style.display = 'none';
	close.parentNode.style.display = 'block';
	history[0] = 1;
	document.cookie = 'popasp_show_page_trace='+history.join('|')
}
close.onclick = function(){
	trace.style.display = 'none';
this.parentNode.style.display = 'none';
	open.style.display = 'block';
	history[0] = 0;
	document.cookie = 'popasp_show_page_trace='+history.join('|')
}
for(var i = 0; i < tab_tit.length; i++){
	tab_tit[i].onclick = (function(i){
		return function(){
			for(var j = 0; j < tab_cont.length; j++){
				tab_cont[j].style.display = 'none';
				tab_tit[j].style.color = '#999';
			}
			tab_cont[i].style.display = 'block';
			tab_tit[i].style.color = '#000';
			history[1] = i;
			document.cookie = 'popasp_show_page_trace='+history.join('|')
		}
	})(i)
}
parseInt(history[0]) && open.click();
tab_tit[history[1]].click();
})();
</script>
<!--#include file="../../../../../popasp/tpl/poplite_end.inc.txt" -->